/* 
 * File:   Texture.h
 * Author: aljosa
 *
 * Created on June 17, 2010, 3:50 PM
 */

#ifndef _TEXTURE_H
#define	_TEXTURE_H

#include <SDL/SDL_opengl.h>
#include <string>

using namespace std;

namespace xEngine
{
  namespace Resources
  {
        /**********************************************************
         * Texture
         *
         * Class for texture
         * --------------------------------------------------------
         * Aljosa 2007
         * ********************************************************/
        class Texture
        {
        private:
            string filename;   // texture filename

            GLubyte *imageData;	// Data
            unsigned bpp;   // Image Color Depth In Bits Per Pixel
            unsigned width; // Image Width
            unsigned height;    // Image Height
            
            unsigned type;  // Texture type: GL_RGB or GL_RGBA

        public:
            unsigned texID; // For fast access

            // constructor
            Texture() {}
            Texture(string filename);
            Texture(string filename, string type, bool filter);
            ~Texture();

            // protoypes
            bool loadTGA();
            void generateTextureMipmap();
            void generateTextureLinear();
            bool makeTgaTexture(bool mipmap);

            // getters
            unsigned getId(); // Legacy
            string getFilename() const;

            // setters
            void setPath(string filename);
            void release();
    };
  }
}

#endif	/* _TEXTURE_H */

